package com.jiapu.mapper;

import com.jiapu.entity.People_information;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

public interface People_informationMapper{
    @Select("select * from people_information where id_del=0")
    List<People_information> findAllp();

    @Transactional
    @Update("insert into `people_information` (`people_id`,`people_name`,`gender`,`age`,`family_id`,`family_name`,`date_birth`,`picture`,`id_del`) VALUES (#{people_id},#{people_name},#{gender},#{age},#{family_id},#{family_name},#{date_birth},#{picture},0);")
    void savep(People_information people_information);

    @Transactional
    @Update("update people_information set people_name=#{people_name},gender=#{gender},age=#{age},family_id=#{family_id},family_name=#{family_name},date_birth=#{date_birth},picture=#{picture} where people_id=#{people_id}")
    void updateByIdp(People_information people_information);

    @Transactional
    @Update("update people_information set id_del=1 where people_id=#{people_id}")
    void deleteByIdp(People_information people_information);
}
